package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the OPPORTUNITY database table.
 * 
 */
@Entity
@NamedQuery(name="Opportunity.findAll", query="SELECT o FROM Opportunity o")
public class Opportunity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="OPPORTUNITY_OPPORTUNITYID_GENERATOR", sequenceName="SEQ_29")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="OPPORTUNITY_OPPORTUNITYID_GENERATOR")
	@Column(name="OPPORTUNITY_ID")
	private long opportunityId;

	@Column(name="CUSTOMER_ID")
	private BigDecimal customerId;

	@Column(name="CUSTOMER_LINK_ID")
	private BigDecimal customerLinkId;

	@Column(name="CUSTOMER_LINK_MAN")
	private String customerLinkMan;

	@Column(name="CUSTOMER_NAM")
	private String customerNam;

	@Temporal(TemporalType.DATE)
	@Column(name="OPPORTUNITY_FXDATE")
	private Date opportunityFxdate;

	@Column(name="OPPORTUNITY_FZR")
	private String opportunityFzr;

	@Column(name="OPPORTUNITY_FZR_ID")
	private BigDecimal opportunityFzrId;

	@Temporal(TemporalType.DATE)
	@Column(name="OPPORTUNITY_GXDATE")
	private Date opportunityGxdate;

	@Column(name="OPPORTUNITY_JSKF")
	private String opportunityJskf;

	@Column(name="OPPORTUNITY_KFXQ")
	private String opportunityKfxq;

	@Column(name="OPPORTUNITY_LX")
	private BigDecimal opportunityLx;

	@Column(name="OPPORTUNITY_LY")
	private BigDecimal opportunityLy;

	@Column(name="OPPORTUNITY_TDCP")
	private String opportunityTdcp;

	@Column(name="OPPORTUNITY_TGR")
	private String opportunityTgr;

	@Column(name="OPPORTUNITY_THERE")
	private String opportunityThere;

	@Column(name="OPPORTUNITY_XCJG")
	private String opportunityXcjg;

	@Column(name="OPPORTUNITY_YXCP")
	private String opportunityYxcp;

	@Column(name="OPPORTUNITY_ZT")
	private String opportunityZt;

	@Column(name="SOURCE_ID")
	private BigDecimal sourceId;

	//bi-directional many-to-one association to Demand
	@ManyToOne
	@JoinColumn(name="DEMAND_ID")
	private Demand demand;

	//bi-directional many-to-one association to Plan
	@OneToMany(mappedBy="opportunity")
	private List<Plan> plans;

	public Opportunity() {
	}

	public long getOpportunityId() {
		return this.opportunityId;
	}

	public void setOpportunityId(long opportunityId) {
		this.opportunityId = opportunityId;
	}

	public BigDecimal getCustomerId() {
		return this.customerId;
	}

	public void setCustomerId(BigDecimal customerId) {
		this.customerId = customerId;
	}

	public BigDecimal getCustomerLinkId() {
		return this.customerLinkId;
	}

	public void setCustomerLinkId(BigDecimal customerLinkId) {
		this.customerLinkId = customerLinkId;
	}

	public String getCustomerLinkMan() {
		return this.customerLinkMan;
	}

	public void setCustomerLinkMan(String customerLinkMan) {
		this.customerLinkMan = customerLinkMan;
	}

	public String getCustomerNam() {
		return this.customerNam;
	}

	public void setCustomerNam(String customerNam) {
		this.customerNam = customerNam;
	}

	public Date getOpportunityFxdate() {
		return this.opportunityFxdate;
	}

	public void setOpportunityFxdate(Date opportunityFxdate) {
		this.opportunityFxdate = opportunityFxdate;
	}

	public String getOpportunityFzr() {
		return this.opportunityFzr;
	}

	public void setOpportunityFzr(String opportunityFzr) {
		this.opportunityFzr = opportunityFzr;
	}

	public BigDecimal getOpportunityFzrId() {
		return this.opportunityFzrId;
	}

	public void setOpportunityFzrId(BigDecimal opportunityFzrId) {
		this.opportunityFzrId = opportunityFzrId;
	}

	public Date getOpportunityGxdate() {
		return this.opportunityGxdate;
	}

	public void setOpportunityGxdate(Date opportunityGxdate) {
		this.opportunityGxdate = opportunityGxdate;
	}

	public String getOpportunityJskf() {
		return this.opportunityJskf;
	}

	public void setOpportunityJskf(String opportunityJskf) {
		this.opportunityJskf = opportunityJskf;
	}

	public String getOpportunityKfxq() {
		return this.opportunityKfxq;
	}

	public void setOpportunityKfxq(String opportunityKfxq) {
		this.opportunityKfxq = opportunityKfxq;
	}

	public BigDecimal getOpportunityLx() {
		return this.opportunityLx;
	}

	public void setOpportunityLx(BigDecimal opportunityLx) {
		this.opportunityLx = opportunityLx;
	}

	public BigDecimal getOpportunityLy() {
		return this.opportunityLy;
	}

	public void setOpportunityLy(BigDecimal opportunityLy) {
		this.opportunityLy = opportunityLy;
	}

	public String getOpportunityTdcp() {
		return this.opportunityTdcp;
	}

	public void setOpportunityTdcp(String opportunityTdcp) {
		this.opportunityTdcp = opportunityTdcp;
	}

	public String getOpportunityTgr() {
		return this.opportunityTgr;
	}

	public void setOpportunityTgr(String opportunityTgr) {
		this.opportunityTgr = opportunityTgr;
	}

	public String getOpportunityThere() {
		return this.opportunityThere;
	}

	public void setOpportunityThere(String opportunityThere) {
		this.opportunityThere = opportunityThere;
	}

	public String getOpportunityXcjg() {
		return this.opportunityXcjg;
	}

	public void setOpportunityXcjg(String opportunityXcjg) {
		this.opportunityXcjg = opportunityXcjg;
	}

	public String getOpportunityYxcp() {
		return this.opportunityYxcp;
	}

	public void setOpportunityYxcp(String opportunityYxcp) {
		this.opportunityYxcp = opportunityYxcp;
	}

	public String getOpportunityZt() {
		return this.opportunityZt;
	}

	public void setOpportunityZt(String opportunityZt) {
		this.opportunityZt = opportunityZt;
	}

	public BigDecimal getSourceId() {
		return this.sourceId;
	}

	public void setSourceId(BigDecimal sourceId) {
		this.sourceId = sourceId;
	}

	public Demand getDemand() {
		return this.demand;
	}

	public void setDemand(Demand demand) {
		this.demand = demand;
	}

	public List<Plan> getPlans() {
		return this.plans;
	}

	public void setPlans(List<Plan> plans) {
		this.plans = plans;
	}

	public Plan addPlan(Plan plan) {
		getPlans().add(plan);
		plan.setOpportunity(this);

		return plan;
	}

	public Plan removePlan(Plan plan) {
		getPlans().remove(plan);
		plan.setOpportunity(null);

		return plan;
	}

}